Dynomotion

Group: DynoMotion Message: 11647 From: moray_cuthill Date: 6/5/2015
Subject: Lathe - Moving from Mach3 to KMotionCNC

Hi,


after getting a bit fed up with Mach3 glitches, I'm considering switching to KMotionCNC on the lathe, however I'm wondering if anybody else has done this, and what issues I might encounter.


Having had a bit play with KMotionCNC (not connected to anything), my main concerns are surrounding tools.


My ATC is controlled via Modbus by a PLC, combined with one output (ChangeAllowed - to signal a change is allowed) and one input (Turret OK - confirms the current/actual position matches the requested position).

The turret position is continually read from the PLC and stored in a user variable, and the requested position is stored in a user variable and continually written to the PLC.


At the moment it's handled via anM6 macro in Mach, which goes along the lines of -

Send new tool position, wait for TurretOK signal to go low (confirms the PLC has received the new tool position), set ChangeAllowed high (tells the PLC it's ok to move the turret), wait for TurretOK to go high (confirms the turret is now at requested position and locked), set ChangeAllowed low.


There is also some logic in the macro so that if the requested position already matches the existing position, then it does nothing.


So the questions I'd like answered are -


1) I'm guessing this is just a case of re-writing the macro in C, and setting the M6 in KMotionCNC to Execute Prog?


2) How are tool offsets set?

I know in Mach, you simply take a cut, measure, enter the value, and the tool table is updated.


3) And finally, is there any easy way to handle swapping tools/offsets in the turret?

My turrent only has 6 positions, so I regularly swap tools, and in Mach this is handled by the 4 number T command, where the first two digits are the tool position to use, and the second two the tool offsets to use.


Anybody with any general experience of using KMotionCNC for a lathe is very welcome to add their thoughts to this.


Thanks,

Moray

Group: DynoMotion Message: 11649 From: Tom Kerekes Date: 6/5/2015
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 11652 From: Moray Cuthill Date: 6/6/2015
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12749 From: Moray Cuthill Date: 2/1/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12751 From: Tom Kerekes Date: 2/2/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK

On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12753 From: Moray Cuthill Date: 2/2/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12755 From: Tom Kerekes Date: 2/3/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Hi Moray,

You will still need a loop in your init Program to control the sign magnitude aspect of your Spindle in exactly the same manner as with Mach3 in order to have the KFLOP axis work properly.

Regards
TK

On 2/2/2016 4:07 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12760 From: Moray Cuthill Date: 2/6/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
The final question (hopefully!) regarding the spindle/KmotionCNC setup, is the mach3 control program currently enables/disables the axis.

Would it be best to keep this method?
The pro I see, is with the axis disabled, spinning the spindle shouldn't cause any issues with the channel output building up any major output commands. With a mill, it wouldn't really be an issue, however with a lathe, there are times when the spindle may get spun a few times by hand, so the output error can build up.
However it obviously involves a bit more coding on my part, to make sure it gets enabled/disabled cleanly.

Thanks,
Moray

On Wed, Feb 3, 2016 at 4:46 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

You will still need a loop in your init Program to control the sign magnitude aspect of your Spindle in exactly the same manner as with Mach3 in order to have the KFLOP axis work properly.

Regards
TK



On 2/2/2016 4:07 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12762 From: Tom Kerekes Date: 2/6/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Hi Moray,

I'm not sure I understand, but if you enable the axes with EnableAxisDest(x,chx->Position); then the axis should enabel ans servo to wherever it is without any "jump" regardless of how far it was moved.

Regards
TK

On 2/6/2016 8:26 AM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
The final question (hopefully!) regarding the spindle/KmotionCNC setup, is the mach3 control program currently enables/disables the axis.

Would it be best to keep this method?
The pro I see, is with the axis disabled, spinning the spindle shouldn't cause any issues with the channel output building up any major output commands. With a mill, it wouldn't really be an issue, however with a lathe, there are times when the spindle may get spun a few times by hand, so the output error can build up.
However it obviously involves a bit more coding on my part, to make sure it gets enabled/disabled cleanly.

Thanks,
Moray

On Wed, Feb 3, 2016 at 4:46 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

You will still need a loop in your init Program to control the sign magnitude aspect of your Spindle in exactly the same manner as with Mach3 in order to have the KFLOP axis work properly.

Regards
TK



On 2/2/2016 4:07 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12763 From: Moray Cuthill Date: 2/6/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Hi Tom,

Looking at the spindle CSS jog examples, they rely on the spindle axis being permanently enabled, issuing the required jog, and simply turning on/off the relevant direction bit.

My current Mach setup works by the spindlejog program enabling/disabling the spindle axis and issuing the jog, with my custom output handling detecting the axis enable status, and activating the relevant output depending on the axis channel output.

I was wondering if one method would be 'better'?


I'm also now working on my tool changer.

I'm aware of all the functions for passing various variables back and forth, and I see there's a nice non-blocking example, however I'm failing to understand the basic process of how slot/id/offsets are set/changed.

If I set-up tools with IDs, is it then up to me to ensure each slot is only used once?

If I then use the tool IDs within the G-code, what value is then passed to the M6 program?
I.e. if I command a T1017 which is for a tool mounted in slot 4, what value gets transferred to the KFlop.

Once a tool change has occurred, how are the offsets updated?
Is it handled automatically by KMotionCNC, or do I need to include functions in my M6 program to handle updating offsets?

Many Thanks,
Moray

On Sun, Feb 7, 2016 at 12:35 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'm not sure I understand, but if you enable the axes with EnableAxisDest(x,chx->Position); then the axis should enabel ans servo to wherever it is without any "jump" regardless of how far it was moved.

Regards
TK



On 2/6/2016 8:26 AM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
The final question (hopefully!) regarding the spindle/KmotionCNC setup, is the mach3 control program currently enables/disables the axis.

Would it be best to keep this method?
The pro I see, is with the axis disabled, spinning the spindle shouldn't cause any issues with the channel output building up any major output commands. With a mill, it wouldn't really be an issue, however with a lathe, there are times when the spindle may get spun a few times by hand, so the output error can build up.
However it obviously involves a bit more coding on my part, to make sure it gets enabled/disabled cleanly.

Thanks,
Moray

On Wed, Feb 3, 2016 at 4:46 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

You will still need a loop in your init Program to control the sign magnitude aspect of your Spindle in exactly the same manner as with Mach3 in order to have the KFLOP axis work properly.

Regards
TK



On 2/2/2016 4:07 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12767 From: TK Date: 2/8/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Hi Moray,

Yes it is up to you to make sure the Tool Slots are correctly entered and only specified for the correct tool.

For Tool Change M6 the Slot number is passed in the specified Var as this is what would normally be required for a tool changer and the ID is passed in the next Var.

HTH
Regards
TK


On 2/6/2016 4:48 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Hi Tom,

Looking at the spindle CSS jog examples, they rely on the spindle axis being permanently enabled, issuing the required jog, and simply turning on/off the relevant direction bit.

My current Mach setup works by the spindlejog program enabling/disabling the spindle axis and issuing the jog, with my custom output handling detecting the axis enable status, and activating the relevant output depending on the axis channel output.

I was wondering if one method would be 'better'?


I'm also now working on my tool changer.

I'm aware of all the functions for passing various variables back and forth, and I see there's a nice non-blocking example, however I'm failing to understand the basic process of how slot/id/offsets are set/changed.

If I set-up tools with IDs, is it then up to me to ensure each slot is only used once?

If I then use the tool IDs within the G-code, what value is then passed to the M6 program?
I.e. if I command a T1017 which is for a tool mounted in slot 4, what value gets transferred to the KFlop.

Once a tool change has occurred, how are the offsets updated?
Is it handled automatically by KMotionCNC, or do I need to include functions in my M6 program to handle updating offsets?

Many Thanks,
Moray

On Sun, Feb 7, 2016 at 12:35 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'm not sure I understand, but if you enable the axes with EnableAxisDest(x,chx->Position); then the axis should enabel ans servo to wherever it is without any "jump" regardless of how far it was moved.

Regards
TK



On 2/6/2016 8:26 AM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
The final question (hopefully!) regarding the spindle/KmotionCNC setup, is the mach3 control program currently enables/disables the axis.

Would it be best to keep this method?
The pro I see, is with the axis disabled, spinning the spindle shouldn't cause any issues with the channel output building up any major output commands. With a mill, it wouldn't really be an issue, however with a lathe, there are times when the spindle may get spun a few times by hand, so the output error can build up.
However it obviously involves a bit more coding on my part, to make sure it gets enabled/disabled cleanly.

Thanks,
Moray

On Wed, Feb 3, 2016 at 4:46 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

You will still need a loop in your init Program to control the sign magnitude aspect of your Spindle in exactly the same manner as with Mach3 in order to have the KFLOP axis work properly.

Regards
TK



On 2/2/2016 4:07 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12768 From: Moray Cuthill Date: 2/8/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
Thanks for clarifying that Tom.

One quick question, I'm guessing MsgBox() is a blocking function?

I'm now reasonably confident I'll have most of the coding done for a trial run later this week, and then I just need to work on the tool setting scripts.
BTW, enjoy ATX. Looks like an interesting event.

Thanks,
Moray

On Mon, Feb 8, 2016 at 6:18 PM, TK tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

Yes it is up to you to make sure the Tool Slots are correctly entered and only specified for the correct tool.

For Tool Change M6 the Slot number is passed in the specified Var as this is what would normally be required for a tool changer and the ID is passed in the next Var.

HTH
Regards
TK




On 2/6/2016 4:48 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Hi Tom,

Looking at the spindle CSS jog examples, they rely on the spindle axis being permanently enabled, issuing the required jog, and simply turning on/off the relevant direction bit.

My current Mach setup works by the spindlejog program enabling/disabling the spindle axis and issuing the jog, with my custom output handling detecting the axis enable status, and activating the relevant output depending on the axis channel output.

I was wondering if one method would be 'better'?


I'm also now working on my tool changer.

I'm aware of all the functions for passing various variables back and forth, and I see there's a nice non-blocking example, however I'm failing to understand the basic process of how slot/id/offsets are set/changed.

If I set-up tools with IDs, is it then up to me to ensure each slot is only used once?

If I then use the tool IDs within the G-code, what value is then passed to the M6 program?
I.e. if I command a T1017 which is for a tool mounted in slot 4, what value gets transferred to the KFlop.

Once a tool change has occurred, how are the offsets updated?
Is it handled automatically by KMotionCNC, or do I need to include functions in my M6 program to handle updating offsets?

Many Thanks,
Moray

On Sun, Feb 7, 2016 at 12:35 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'm not sure I understand, but if you enable the axes with EnableAxisDest(x,chx->Position); then the axis should enabel ans servo to wherever it is without any "jump" regardless of how far it was moved.

Regards
TK



On 2/6/2016 8:26 AM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
The final question (hopefully!) regarding the spindle/KmotionCNC setup, is the mach3 control program currently enables/disables the axis.

Would it be best to keep this method?
The pro I see, is with the axis disabled, spinning the spindle shouldn't cause any issues with the channel output building up any major output commands. With a mill, it wouldn't really be an issue, however with a lathe, there are times when the spindle may get spun a few times by hand, so the output error can build up.
However it obviously involves a bit more coding on my part, to make sure it gets enabled/disabled cleanly.

Thanks,
Moray

On Wed, Feb 3, 2016 at 4:46 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

You will still need a loop in your init Program to control the sign magnitude aspect of your Spindle in exactly the same manner as with Mach3 in order to have the KFLOP axis work properly.

Regards
TK



On 2/2/2016 4:07 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK

Group: DynoMotion Message: 12871 From: Moray Cuthill Date: 2/26/2016
Subject: Re: Lathe - Moving from Mach3 to KMotionCNC
I think I've now got everything written I need to get the basic machine running as intended, but need a couple questions answered.

For the spindle control programs/settings in KMotionCNC, can the spindle speed, and spindle on/off/css scripts all be set to use the same thread?
I'm thinking that if you have a M6 S2000, both the speed and on scripts are going to be loaded at the same time..

And is there any dwell built into any of the spindle control?
Or would I have to modify the spindle jog program to issue a feedhold until the speed neared the requested speed?
I'd ideally like motion to wait for the spindle speed to be near the requested speed before motion (re)starts, as my the VFD on my spindle is a bit slow to get things up to speed although I suspect a bit extra servo loop tuning may help in that regard.

Thanks,
Moray



On Mon, Feb 8, 2016 at 9:40 PM, Moray Cuthill <moray.cuthill@...> wrote:
Thanks for clarifying that Tom.

One quick question, I'm guessing MsgBox() is a blocking function?

I'm now reasonably confident I'll have most of the coding done for a trial run later this week, and then I just need to work on the tool setting scripts.
BTW, enjoy ATX. Looks like an interesting event.

Thanks,
Moray

On Mon, Feb 8, 2016 at 6:18 PM, TK tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

Yes it is up to you to make sure the Tool Slots are correctly entered and only specified for the correct tool.

For Tool Change M6 the Slot number is passed in the specified Var as this is what would normally be required for a tool changer and the ID is passed in the next Var.

HTH
Regards
TK




On 2/6/2016 4:48 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Hi Tom,

Looking at the spindle CSS jog examples, they rely on the spindle axis being permanently enabled, issuing the required jog, and simply turning on/off the relevant direction bit.

My current Mach setup works by the spindlejog program enabling/disabling the spindle axis and issuing the jog, with my custom output handling detecting the axis enable status, and activating the relevant output depending on the axis channel output.

I was wondering if one method would be 'better'?


I'm also now working on my tool changer.

I'm aware of all the functions for passing various variables back and forth, and I see there's a nice non-blocking example, however I'm failing to understand the basic process of how slot/id/offsets are set/changed.

If I set-up tools with IDs, is it then up to me to ensure each slot is only used once?

If I then use the tool IDs within the G-code, what value is then passed to the M6 program?
I.e. if I command a T1017 which is for a tool mounted in slot 4, what value gets transferred to the KFlop.

Once a tool change has occurred, how are the offsets updated?
Is it handled automatically by KMotionCNC, or do I need to include functions in my M6 program to handle updating offsets?

Many Thanks,
Moray

On Sun, Feb 7, 2016 at 12:35 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'm not sure I understand, but if you enable the axes with EnableAxisDest(x,chx->Position); then the axis should enabel ans servo to wherever it is without any "jump" regardless of how far it was moved.

Regards
TK



On 2/6/2016 8:26 AM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
The final question (hopefully!) regarding the spindle/KmotionCNC setup, is the mach3 control program currently enables/disables the axis.

Would it be best to keep this method?
The pro I see, is with the axis disabled, spinning the spindle shouldn't cause any issues with the channel output building up any major output commands. With a mill, it wouldn't really be an issue, however with a lathe, there are times when the spindle may get spun a few times by hand, so the output error can build up.
However it obviously involves a bit more coding on my part, to make sure it gets enabled/disabled cleanly.

Thanks,
Moray

On Wed, Feb 3, 2016 at 4:46 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

You will still need a loop in your init Program to control the sign magnitude aspect of your Spindle in exactly the same manner as with Mach3 in order to have the KFLOP axis work properly.

Regards
TK



On 2/2/2016 4:07 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
Ah, I never thought about looking in the help (I did look at the help page for the tool setup page, but didn't think to actually check the manual!)

Now that I know what files to use, I need to clarify how to control the spindle.
As it stands, my Mach spindle control C program, enables the axis, and sets a JOG. Then in my init.c loop, there is a section that monitors for the spindle channel being enabled, then activates the desired CW/CCW bit depending on the channel and controls the DAC (flipping the output when needed to always ensure a positive voltage).

Now looking at the Jog examples, it looks like I can simply rely on the CSS/Jog example files to control everything for me, without the need for any custom handling of the channel/axis output?

Thanks,
Moray

On Tue, Feb 2, 2016 at 6:28 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Moray,

I'd recommend using the code in \C Programs\SpindleUsingJogs\CSS. 

Speeds will change when a GCode "S" word is programmed (when the Spindle has been turned on) as the Interpreter will launch the C Program for each S word.  So there is no infinite loop required.   With a CSS active an infinite service loop is required as KFLOP must constantly change the Spindle speed based on the current radius.  See:

http://dynomotion.com/Help/KMotionCNC/SpindleControl.htm#CSS_-_Constant_Surface_Speed

HTH
Regards
TK



On 2/1/2016 5:23 PM, Moray Cuthill moray.cuthill@... [DynoMotion] wrote:
 
So, after 6 months of trouble free running with Mach, Mach decided it was time to command a spindle stop instead of a speed change just prior to trying to drill a hole, resulting in one snapped drill, and a turret and spindle that no longer point where they should.
As a result, I'm finally making the effort to move to KMotionCNC.


I'm currently struggling to get my head around configuring the spindle.
My spindle is a VFD running using closed loop, via a Jog command on Axis/Channel 2, and a custom loop within my init.c that takes the channel output, activates the relevant direction bit depending on CW/CCW while always outputting a positive voltage (VFD only takes 0-10V)

I've found the SpindleUsingJogs examples folder. What is the difference between the versions?
The JogDir and JogV2 files appear to be identical, and the Jog doesn't use as many defines.

Also, those take the spindle speed when executed, however is there an example for changing the spindle speed without issuing a M4/5 command? Looking at the Jog examples, they don't have any infinite loops, so simply updating the speed var would appear to not do anything, unless I'm missing something?


If I wanted to implement the CSS, would I be better to do that now, or wait until after I've got the basic spindle jog option working?
I've got no immediate need for CSS, however I can see it coming in useful in future.

Thanks,
Moray

On Sat, Jun 6, 2015 at 2:15 PM, Moray Cuthill <moray.cuthill@...> wrote:
Hi Tom,

thanks for the reply.

1) I would of probably figured the Exec/Wait/Sync option out the first time the turret took off towards the spindle mid change!

2) Sounds doable. I'm guessing this would need the use of VisualStudio inorder to edit the screen?
It's not a major issue, as I'd probably want to remove the tool drop down menu, as I rely on G-Code for moving the turret to a safe distant prior to changing tools. Although I may consider changing this, as I won't lose vast amounts of time by having the M6 script fully move the turret  to the travel limits for each change.

3) Just realised I had installed an old version, which didn't have the tool slot/id functions. All makes sense now I've installed a later version.

Thanks,
Moray

On Sat, Jun 6, 2015 at 3:22 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 
Hi Moray,

Regarding:

#1 Yes I believe so.  But you would probably want Exec/wait/Sync so that the GCode wait until the Tool Change finishes successfully.

#2 I believe you would need to cut, measure, then enter the difference between what the x the part was cut at and the measurement into the tool table.

You should be able to make a User Button to ask the measurement, do the calculation, and set the Tool Table 

#3 one way to do a similar thing would be to use the Tool ID and Tool Slot feature of the Tool Table.  If the tools are swapped then update the Tool Table Slot numbers to have the correct Slot numbers for each tool.

HTH
Regards
TK